package com.distribute.application.api.rest.member;


import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.distribute.application.api.BaseApiController;
import com.distribute.framework.core.lang.Protocol;
import com.distribute.framework.core.lang.title;
import com.distribute.framework.model.HeedCoupon;
import com.distribute.framework.model.Member;
@RestController(value="api.MemberOherController")
public class MemberOherController extends BaseApiController{
	/**
	 * 会员获取当前品牌关注有礼二维码
	 * @return
	 */
	@RequestMapping("/api/memberOhter/getGzBs.do")
	public @title("会员获取当前品牌关注有礼二维码") Protocol getGzBs(
			@title("品牌编号") Long banrdId
			){
		Protocol protocol = Protocol.create(true, null);
		Member member=Member.where.uid(this.getUid()).get();
		if (member==null) {
			return Protocol.create(false, "操作错误","not_found_user");
		}
		HeedCoupon heedCoupon=HeedCoupon.where.merchant(banrdId).get();
		protocol.set("gzyl", heedCoupon==null?null:heedCoupon.toJSON());
		return protocol;
	}
}
